package com.bw.zg2.arouter

import android.content.Context
import com.alibaba.android.arouter.facade.Postcard
import com.alibaba.android.arouter.facade.annotation.Route
import com.alibaba.android.arouter.facade.service.DegradeService
import com.alibaba.android.arouter.launcher.ARouter

/**
 *
 * @ClassName: JiangjiServcie
 * @Description: 通过Arouter实现 页面降级服务
 * @Author: zhangyanchao
 * @CreateDate: 2024/9/20 3:13 PM
 * @Version: 1.0
 */
@Route(path = "/service/test")
class JiangjiService :DegradeService{
    override fun init(context: Context?) {
    }

    override fun onLost(context: Context?, postcard: Postcard?) {
        //兜底逻辑，跳转到统一的错误页面
        //greenChannel() 绿色渠道，不经过拦截器
        ARouter.getInstance()
            .build("/common/ErrorActivity")
            .greenChannel()
            .navigation()

    }
}